#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <easyx.h>
#include <stdlib.h>
#include <time.h>
using namespace std;

int main()
{

	initgraph(800,600);
	setbkcolor(WHITE);
	cleardevice();
	setorigin(400, 300);
	setaspectratio(1, -1);

	float s = 0.76;
	float ds = 0.76 / 600;
	for (int i = 300; i >-300; i--)
	{
		setlinecolor(HSVtoRGB(181, s, 0.95));
		line(-400, i, 400, i);
		s -= ds;
	}

	srand((unsigned int)time(NULL));

	for (int i = 0; i < 360; i++)
	{
		int x = rand() % (801) - 400;
		int y = rand() % (601) - 300;
		putpixel(x, y, RGB(i, 1, 1));
	}

	setlinecolor(CYAN);
	setlinestyle(PS_ENDCAP_FLAT);
	setlinestyle(PS_SOLID, 3);
	line(-400, 0, 390, 0);
	line(0, -300, 0, 290);

	setfillcolor(CYAN);
	POINT points_x[3] = { {0,300},{-10,290},{10,290} };
	solidpolygon(points_x, 3);
	POINT points_y[3] = { {400,0},{390,10},{390,-10} };
	solidpolygon(points_y, 3);

	setfillcolor(RGB(140, 242, 237));
	setlinestyle(PS_DASH, 2);
	fillcircle(-66, 66, 66);

	setfillcolor(RGB(214, 251, 189));
	fillellipse(-150, 100, -100, 0);
	fillellipse(-35, 100, 15, 0);

	//begin
	HRGN circle = CreateEllipticRgn(400, 300, 500, 400);
	setcliprgn(circle);

	setfillcolor(BLACK);
	solidcircle(0, 0, 200);

	setcliprgn(NULL);
	DeleteObject(circle);
	//+end




	getchar();
	closegraph();
	return 0;
}
